home *** CD-ROM | disk | FTP | other *** search
- Path: stern.fokus.gmd.de!news
- From: Watson <sayegh@fokus.gmd.de>
- Newsgroups: comp.lang.c++
- Subject: Re: Need some simple help with C++
- Date: Fri, 23 Feb 1996 18:15:41 +0100
- Organization: GMD FOKUS - Research Institute for Open Communication Systems
- Message-ID: <312DF63D.6BD4@fokus.gmd.de>
- References: <4gi81k$ebb@sphinx.Gsu.EDU>
- NNTP-Posting-Host: pollux.fokus.gmd.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-2
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.4 sun4m)
-
- Louis Miller Hall wrote:
- > #include <fstream.h>
- >
- > char *name;
- > int a = 1;
- >
- > void main ()
- ^^^^
- I guess, this will never end :(
- It's
-
- int main()
-
- > {
- > while (a)
- > {
- > name = new char[80];
- > cout << "What is the string >" << endl;
- > cin.getline(name, 80);
- > cout << "The string entered is >" << name << endl;
- > cout << "Enter 0 to quit, any other to continue>";
- > cin >> a;
- After entering the number, there will still be a newline character
- in the stream. This char will be the input of the next getline().
-
- --
- * Greetinx from Watson (sayegh@fokus.gmd.de)
- http://www.fokus.gmd.de/ovma/employees/sayegh/entry.html
- signal(SIGSEGV,SIG_IGN);
-